package com.ruibang.glass.purchase.service.impl;


import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruibang.glass.purchase.domain.req.PurchaseSupplierReq;
import com.ruibang.glass.purchase.entity.ProcureSupplierManagement;
import com.ruibang.glass.purchase.mapper.ProcureSupplierManagementMapper;
import com.ruibang.glass.purchase.service.ProcureSupplierManagementService;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 供应商管理表，用于记录供应商的基本信息和联系方式 服务实现类
 * </p>
 *
 * @author mameng
 * @since 2024-03-28
 */
@Service
public class PurchaseSupplierManagementServiceImpl extends ServiceImpl<ProcureSupplierManagementMapper, ProcureSupplierManagement> implements ProcureSupplierManagementService {

    @Override
    public IPage<ProcureSupplierManagement> getPage(PurchaseSupplierReq purchaseContractsReq) {
        return baseMapper.getPage(new Page<>(purchaseContractsReq.getPageNo(), purchaseContractsReq.getPageSize()), purchaseContractsReq);
    }

    /**
     * 新增供应商
     * @param procureSupplierManagement
     */
    @Override
    public void addSupplier(ProcureSupplierManagement procureSupplierManagement) {
        baseMapper.insert(procureSupplierManagement);
    }
}
